<!DOCTYPE html>
<html lang="en" ng-app="app">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/1.4.8/angular.js"></script>
</head>
<body>
<div ng-controller="myCtrl">
    <div>
        a的值：{{a}}<br>
        b的值：{{b}}
    </div>
    <div>
        普通方式：<input type="checkbox" ng-model="a">
    </div>
    <div ng-if="!a">
        ng-if方式：<input type="checkbox" ng-model="$parent.b">
    </div>
</div>
<script type="application/javascript">
    var app = angular.module("app", []);
    app.controller("myCtrl", ["$scope", function ($scope) {
        $scope.a = false;
        $scope.b = false;
    }]);
</script>
</body>
</html>